POV-Ray : Newsgroups : povray.beta-test : Operator promotion in array initializer : Operator promotion in array initializer Server Time
2 Nov 2024 17:21:20 EDT (-0400)
  Operator promotion in array initializer  
From: Philippe Debar
Date: 18 Oct 2001 16:07:55
Message: <3bcf369b@news.povray.org>
Operator promotion does not work in arry initializer. Doc implicitly say it
should.

----
#declare arTest=array[2] {<1,2,3>,0} ;
----

gives :
----
#declare arTest=array[2] {<1,2,3>,0} <----ERROR

Parse Error: Attempted to redefine vector identifier as float identifier.
----


Doc : "6.1.4.4  Operator Promotion"

"Versions of POV-Ray prior to 3.0 only allowed such use of a float as a
vector in various limited places such as scale and turbulence. However you
may now use this trick anywhere"




BTW,  I find the two following errors rather unclear in their (automatic?)
wording :

---
#declare arTest=array[2] {<1,2,3>,<0,0,0>,0 <----ERROR

Parse Error: No matching } in '{', float function 'float constant' found
instead
---


and


---
#declare arTest=array[3] {<1,2,3>,<0,0,0>} <----ERROR

Parse Error: Attempted to redefine vector identifier as object identifier.
---




Sys info :
POV-Ray 3.5 b6
Win 2k pro sp2
Ahtlon 1.2 GHz
512 MB DDR



Povingly,


Philippe


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.